package com.itany.corejava.day04;

import java.util.Scanner;

public class Test3 {

    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);

        int score=0;

        for (int i = 0; i < 10; i++) {
            System.out.println("第"+(i+1)+"题");

            int x=(int)(Math.random()*(99-10+1))+10;
            int y=(int)(Math.random()*(99-10+1))+10;
            int z=(int)(Math.random()*(3-0+1))+0;


            int answer=999999;

            switch (z){
                case 0:
                    System.out.println(x+"+"+y+"=");
                    answer=x+y;
                    break;
                case 1:
                    System.out.println(x+"-"+y+"=");
                    answer=x-y;
                    break;
                case 2:
                    System.out.println(x+"*"+y+"=");
                    answer=x*y;
                    break;
                case 3:
                    System.out.println(x+"/"+y+"=");
                    answer=x/y;
                    break;
            }

            int result=sc.nextInt();

            if(answer==result){
                score+=10;
            }

        }

        System.out.println("分数为：" + score);
        
        
    }
    
    
    
}
